<template>
    <div>
      <h1>管理员后台</h1>
      <EChartsComponent :chartData="activityChartData" />
      <EChartsComponent :chartData="clubRankingData" />
      <!-- 其他管理功能 -->
    </div>
  </template>
  
  <script>
  import EChartsComponent from '../Layout/EChartComponent.vue';
  import axios from 'axios';
  
  export default {
    components: {
      EChartsComponent
    },
    data() {
      return {
        activityChartData: [],
        clubRankingData: []
      };
    },
    created() {
      this.fetchData();
    },
    methods: {
      async fetchData() {
        try {
          const [activityResponse, clubResponse] = await Promise.all([
            axios.get('/api/activity/hot'),
            axios.get('/api/club/ranking')
          ]);
          this.activityChartData = activityResponse.data;
          this.clubRankingData = clubResponse.data;
        } catch (error) {
          console.error(error);
        }
      }
    }
  };
  </script>